From: Jonathan Dieter Date: Mon, 16 Apr 2018 09:42:52 +0000 (+0300) Subject: Reorganize header so download stuff is at the end X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~321 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3736802e5e92f0737533546a045d599f1c79aec1;p=zchunk.git Reorganize header so download stuff is at the end Signed-off-by: Jonathan Dieter --- diff --git a/include/zck.h b/include/zck.h index 82f311b..673bf25 100644 --- a/include/zck.h +++ b/include/zck.h @@ -40,6 +40,8 @@ typedef enum zck_log_type { ZCK_LOG_ERROR } zck_log_type; +typedef struct zckCtx zckCtx; +typedef struct zckHash zckHash; /* Contains an index item pointing to a chunk */ typedef struct zckIndexItem { @@ -61,38 +63,6 @@ typedef struct zckIndex { zckIndexItem *first; } zckIndex; -/* Contains a single range */ -typedef struct zckRangeItem { - size_t start; - size_t end; - struct zckRangeItem *next; - struct zckRangeItem *prev; -} zckRangeItem; - -/* Contains a series of ranges, information about them, a link to the first - * range item, and an index describing what information is in the ranges */ -typedef struct zckRange { - unsigned int count; - unsigned int segments; - unsigned int max_ranges; - zckRangeItem *first; - zckIndex index; -} zckRange; - -typedef struct zckDLPriv zckDLPriv; -typedef struct zckCtx zckCtx; -typedef struct zckHash zckHash; - -/* Contains a zchunk download context */ -typedef struct zckDL { - size_t dl; - size_t ul; - int dst_fd; - char *boundary; - zckRange info; - zckDLPriv *priv; - struct zckCtx *zck; -} zckDL; /******************************************************************* * Reading a zchunk file @@ -220,6 +190,40 @@ const char *zck_hash_name_from_type(int hash_type); int zck_hash_check_data(zckCtx *zck, int dst_fd); +/******************************************************************* + * Downloading (should this go in a separate header and library?) + *******************************************************************/ +/* Contains a single range */ +typedef struct zckRangeItem { + size_t start; + size_t end; + struct zckRangeItem *next; + struct zckRangeItem *prev; +} zckRangeItem; + +/* Contains a series of ranges, information about them, a link to the first + * range item, and an index describing what information is in the ranges */ +typedef struct zckRange { + unsigned int count; + unsigned int segments; + unsigned int max_ranges; + zckRangeItem *first; + zckIndex index; +} zckRange; + +typedef struct zckDLPriv zckDLPriv; + +/* Contains a zchunk download context */ +typedef struct zckDL { + size_t dl; + size_t ul; + int dst_fd; + char *boundary; + zckRange info; + zckDLPriv *priv; + struct zckCtx *zck; +} zckDL; + /******************************************************************* * Ranges *******************************************************************/ @@ -237,7 +241,7 @@ void zck_range_close(zckRange *info); /******************************************************************* - * Downloading (should this go in a separate header and library?) + * Downloading *******************************************************************/ /* Initialize curl stuff, should be run at beginning of any program using any * following functions */